package com.stu.controller.student;

import com.stu.Dto.ClassJobApplicationDTO;
import com.stu.result.Result;
import com.stu.serive.ClassInformationService;
import com.stu.serive.ViolationService;
import com.stu.vo.ViolationApplicationVo;
import com.stu.vo.ViolationInformationVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/student")
public class ViolationController {

    @Autowired
    private ViolationService violationService;

    /**
     * 查询处分信息
     * @return
     */
    @GetMapping("/violationInformation")
    private Result<List<ViolationInformationVo>> selectViolationInformation(){
        return Result.success( violationService.selectViolationInformation());
    }

    /**
     * 查询处分解除进度
     * @return
     */
    @GetMapping("/violationApplication")
    private Result<List<ViolationApplicationVo>> selectViolationApplication(){
        return Result.success( violationService.selectViolationApplication());
    }

    /**
     * 学生进行取消处分的申请
     * @return
     */
    @PostMapping("/violationApplication")
    public Result deleteViolationApplication(@RequestParam Integer violationId){
        violationService.insertViolationApplication(violationId);
        return Result.success();
    }
}
